﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserLogon.aspx.cs" Inherits="MyBlog.UserLogon" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <script src="JS/jquery-1.8.3.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script type="text/javascript">
        function a() {
            var jsondata =
                '{"usr":"'+ $("#txtusr").attr("value") + '","' +
                'pwd":"' + $("#txtpass").attr("value") + '"}';

            $.ajax({
                type: "POST",
                contentType: "application/json;utf-8",
                url: "/WebService/UserLogon.asmx/userLogon",
                data: jsondata,
                dataType: "json",
                success: function (result) {
                    result = result.d;
                    $("#aa").text("");
                    $("#aa").append(result);
                },
                error: function () {
                    $("#aa").text("");
                    $("#aa").append("error!!!");
                }
            });
        };
    </script>
    <style type="text/css">
        .style1
        {
            width: 25%;
            height: 83px;
        }
        .style2
        {            text-align: center;
        }
        #Button1
        {
            width: 206px;
        }
        .style3
        {
            text-align: right;
            width: 54px;
        }
        .style4
        {
            text-align: left;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div style="text-align: center">
    <table class="style1" style="margin-left: 30%;margin-right: 30%;">
        <tr>
            <td class="style2" colspan="2" id="aa">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style3">
                用户名:</td>
            <td class="style4">
                <input id="Text1" type="text" /></td>
        </tr>
        <tr>
            <td class="style3">
                密码:</td>
            <td class="style4">
                <input id="Password1" type="password" /><input id="Button2" type="button" 
                    value="?" /></td>
        </tr>
        <tr>
            <td class="style2" colspan="2">
                <input id="Button1" type="button" value="Logon" onclick="a()"/> </td>
        </tr>
    </table>
    </div>
    </form>
</body>
</html>
